unit zkRemoteDataTransfer;

interface

uses
  SysUtils, UPluginGroups, UPluginClasses, DB;

procedure RemoteDataTransfer(Request: TParams; var Response: TParams);

implementation

procedure RemoteDataTransfer(Request: TParams; var Response: TParams);
var
  lPluginName: string;
  lCls: TPluginClass;
  lPlugin: TPlugin;
begin
  try
    Response := TParams.Create(nil);
    if Request.FindParam('PluginName') = nil then
    begin
//      with OutParams.Add do
//      begin
//        Name
//      end;
      Exit;
    end;

    lPluginName := Request.ParamByName('PluginName').AsString;
    lCls := PluginGroup.FindItem(lPluginName);
    if lCls = nil then
    begin

      Exit;
    end;
    lPlugin := TPlugin(lCls).Create;
    lPlugin.Execute();
  except
    on E: Exception do
    begin
      Exit;
    end;
  end;
end;

end.
